import React from 'react';
import PropTypes from 'prop-types';
import DefaultToast from '@welab/fx-ui/components/Toast';
// import fn from '@welab/fx-ui/components/PlateformHalf';
import SystemIcon from './SystemIcon';
import { toast } from '../theme';

const Toast = props => <DefaultToast {...props} iconComponent={SystemIcon} />;
Toast.defaultProps = {
  noImg: false,
  status: null,
  theme: toast.toastStatus,
};
Toast.propTypes = {
  /**
   * ### Toast 属性说明
   *
   * 透明弹框
   *
   * | Name | Type | Default | Details | isRequired |
   * | ------:| -----------:| -----------: | -----------: | ------:|
   * | theme | object | | 主题 | no |
   * | label | string | | 主要文字 | yes |
   * | status | string | | sucess或者error或者warning | no |
   * | noImg | bool | false | 没有图标的toast | no |
   *
   * ### Toast 代码示例(详见示例项目)
   *
   * ```html
   * <Toast theme={Toast} label="描述文字">ico</Toast>
   * ```
   */
  theme: PropTypes.instanceOf(Object),
  label: PropTypes.string.isRequired,
  noImg: PropTypes.bool,
  status: PropTypes.string,
};

export default Toast;
